# def print_info(name,age,sex,hobbie='大保健',*args,**kwargs):
#     info = '''
# --------info--------
# name:%s
# age:%d
# sex:%s
# hobbie:%s
#     '''% (name,age,sex,hobbie)
#     if len(args) == 0 and len(kwargs) == 0:
#         print(info)
#     elif len(args) == 0:
#         print(info,kwargs)
#     elif len(kwargs) == 0:
#         print(info,args)
#     else:
#         print(info,args,kwargs)
#
# print_info(name='Alex',age=22,sex='M')
# print_info(name = 'Jack',age = 26,sex = 'm',hobbie = '学习',major = 'python')

# name = 'yyt'
# def names():
#     name = 'csgo'
#     def namess():
#         name = 'dota2'
#         print(name)
#     namess()
#     print(name)
# names()
# print(name)


# n = map(lambda x:x*2 if x > 5 else x*5, [1,4,6,2,7])
# for i in n:
#     print(i)

# def yu(n):
#     return int(str(n).strip(' ').strip('-')) % 3
# def add(x,y,f):
#     return f(x) + f(y)
# print(add(8,  -8,yu))










# a = [1,3,4,6,7,8,9,11,15,17,19,21,22,25,29,33,38,69,107]
# n = int(input('shuru:').isdigit())
# def bbbbbb(n,list):
#     n,a = int(n),len(list)
#     if a > 1:
#         a = int(a / 2)
#         if n == list[a]:
#             print('%dzai' % n)
#         if n < list[a]:
#             list = list[:a]
#             bbbbbb(n,list)
#         else:
#             list = list[a:]
#             bbbbbb(n,list)
#     else:
#         print('%d不在' % n)
# bbbbbb(n,a)





# dict = {}
# f = open(file=r'C:\Users\Administrator\Desktop\33333.txt',mode='r',encoding='utf-8')
# for i in f:
#     i = i.strip().split(',')
#     dict[i[0]] = i
# f.close()
# list_name = list(dict.keys())                   #读取的信息成词典kay为username
# count = 0
# while count < 3:
#     name = input('username:')
#     pasd = input('passwd:')
#     if name not in list_name:
#         print('登录失败再试一次')
#         count +=1
#         continue
#     else:
#         true_pasd = dict[name][1]
#     if pasd != true_pasd:
#         print('登录失败再试一次')
#         count += 1
#     else :
#         print('---------欢迎---------')
#         break
#
# else:
#     print('输入太多账户锁定')                 #账号登录 三次错误锁定
# def info(name):                 #打印个人信息
#     inf = '''
#     -------info-------
#     namn:%s
#     age:%s
#     job:%s
#     dept:%s
#     phone:%s
#     '''%(dict[name][0],dict[name][2],dict[name][3],dict[name][4],dict[name][5])
#     print(inf)
# def modify(name):
#     a = 0
#     print('person data:'+str(dict[name]))
#     for i in dict[name]:
#         print(str(a)+'   '+str(dict['username'][a])+': '+str(i))
#         a += 1
#     change = int(str(input('[select colum id to change]:')))
#     print('current value>:'+str(dict[name][change]))
#     new_change = str(input('new value:'))
#     dict[name][change] = new_change
#     print(dict[name])                                           #改数据
# def save_back():
#     f = open(file=r'C:\Users\Administrator\Desktop\33333.txt', mode='r+', encoding='utf-8')
#     f.seek(0)
#     f.truncate()                            #清空文件
#     for i in dict.values():                                      #整理数据 先去字典val值 在进行以，的分割成字符串 将每行写入
#         row_data = ','.join(i)
#         f.write('%s\n' %row_data)
#     f.close()
# def change_pasd(name):                          #修改密码
#     while True:
#         print('旧密码: '+str(dict[name][1]))
#         change1 = input('修改的新密码:').strip()
#         if change1 == 'q':
#             break
#         else:
#             change2 = input('再输一遍:').strip()
#         if change1 == change2:
#             dict[name][1] = change1
#             print('修改成功')
#             break
#         else:
#             print('两次密码不同')
# while True:                   #选择功能、退出
#     i = '''
#     1. 打印个人信息
#     2. 修改个人信息
#     3. 修改密码'''
#     print(i)
#     choos = str(input(':'))
#     if choos == '1':
#         info(name)
#     elif choos == '2':
#         new_person = modify(name)
#         save_back()
#     elif choos == '3':
#         change_pasd(name)
#         if change_pasd(name) == 0:
#             continue
#         save_back()
#     elif choos == 'q':
#         break
#     else:
#         print('无效指令')
#         continue






# account = {
#     "is_authenticated":False,# 用户登录了就把这个改成True
#     "username":"alex", # 假装这是DB里存的用户信息
#     "password":"abc123" # 假装这是DB里存的用户信息
# }
# def login(func):
#     def inner(*args,**kwargs):
#         count = 0
#         while count < 3:
#             if account["is_authenticated"] is False:
#                 username = input("user:")
#                 password = input("pasword:")
#                 if username == account["username"] and password == account["password"]:
#                     print("welcome login....")
#                     account["is_authenticated"] = True
#                     func(*args,**kwargs)
#                     break
#                 else:
#                     print("wrong username or password!")
#                     count += 1
#             else :  # 主要改了这
#                 print('yi')
#                 func(*args,**kwargs) # 认证成功了就执行传入进来的函数
#                 break
#         else:
#             print('suoding')
#             exit()
#     return inner
# def pay_money(fd):
#     def pay(*args,**kwargs):
#         print('chenggong')
#         fd(*args,**kwargs)
#     return pay
# def home():
#     print("---首页----")
# @login
# @pay_money
# def america(level):
#     if level > 3:
#         print('jiesuo')
#     else:
#         print("----欧美专区----")
# def japan():
#     print("----日韩专区----")
# @login
# def henan():
#     print("----河南专区----")
# home()
# america(4)
# henan()



# a = [1,2,3,4,5,6,7]
#
# print(list(lambda x:x+1,a))

# def fib(n):
#     count,a,b = 0,0,1
#     while count < n:
#         c = a + b
#         a = b
#         b = c
#         yield b
#         count += 1
#
# f = fib(20)
# print(next(f))
# print(next(f))
# print(next(f))
# print(next(f))
# print(next(f))



# def do():
#     while True:
#         a = yield
#         print('%s'% a)
#
# d = do()
# d.__next__()
# for i in range(10):
#     d.send(i)

# from collections import Iterable
# print(isinstance([],Iterable))




# from collections import Iterator
# print(isinstance((x for x in range(10)),Iterator))

